package com.ssy.lingxi.after.sale.model.constant;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 * 售后换货辅助国际化枚举
 * @author 彭冬冬
 * @date 2022/2/17
 * @version 2.0.0
 */
public enum ReplaceGoodsHelpEnum {

    SUBMIT(1, "已提交申请单"),
    SEND_NO(2, "发货单号："),
    AUDIT(3, "已审核退货发货单"),
    RECEIVE_LOGISTICS(4, "接受物流单"),
    RECEIVE_LOGISTICS_NO(5, "物流单号："),
    BE_ADD_REPLACE_GOODS_STORAGE(6, "新增换货入库单"),
    WAREHOUSING_NO(7, "入库单号："),
    ADD_REPLACE_GOODS_STORAGE(8, "已审核换货入库单"),
    IS_REPLACE_RECEIVE_GOODS(9, "换货收货"),
    IS_VERIFY_RETURN_GOODS_STORAGE(10, "已审核退货入库单"),
    ADD_REPLACE_DELIVERY_GOODS(11, "新增换货发货单"),
    BE_ADD_LOGISTICS(12, "待新增换货物流单"),
    REPLACE_DELIVERY_GOODS(13, "换货发货"),
    CONFIRM_REPLACE_GOODS_RECEIPT(14, "换货发货"),
    STOPPED(15, "换货发货"),
    WAIT(16, "待确认换货售后"),
    ;
    private final Integer code;
    private final String message;

    ReplaceGoodsHelpEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getDeclaringClass(), this.getCode());
    }

    public static String getMessage(Integer code) {
        ReplaceGoodsHelpEnum item = Arrays.stream(ReplaceGoodsHelpEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);

        return null != item ? item.getMessage() : "";
    }
}
